<?php
	
	class network
	{
		public $id;
		public $info;
		public $is_private;
		public $is_public;
		
		public function __construct()
		{
			$this->id	= FALSE;
			$this->C	= new stdClass;
			$this->info	= new stdClass;
			$this->cache	= & $GLOBALS['cache'];
			$this->db1		= & $GLOBALS['db1'];
			$this->db2		= & $GLOBALS['db2'];
		}
		
		public function LOAD()
		{
			if( $this->id ) {
				return FALSE;
			}
			$this->load_network_settings();
			$this->info	= (object) array(
				'id'	=> 1,
			);
			$this->is_private	= FALSE;
			$this->is_public	= TRUE;
			$this->id	= $this->info->id;
			return $this->id;
		}
		
		public function load_network_settings()
		{
			$db	= &$this->db1;
			$r	= $db->query('SELECT * FROM settings', FALSE);
			while($obj = $db->fetch_object($r)) {
				$this->C->{$obj->word}	= stripslashes($obj->value);
			}
			
			global $C;
			foreach($this->C as $k=>$v) {
				$C->$k	= & $this->C->$k;
			}
			if( ! isset($C->ATTACH_LINK_DISABLED) ) { $C->ATTACH_LINK_DISABLED = 0; }
			if( ! isset($C->ATTACH_FILE_DISABLED) ) { $C->ATTACH_FILE_DISABLED = 0; }
			if( ! isset($C->ATTACH_IMAGE_DISABLED) ) { $C->ATTACH_IMAGE_DISABLED = 0; }
			if( ! isset($C->ATTACH_VIDEO_DISABLED) ) { $C->ATTACH_VIDEO_DISABLED = 0; }
			if( ! isset($C->HDR_SHOW_COMPANY) ) { $C->HDR_SHOW_COMPANY = 1; }
			if( ! isset($C->HDR_SHOW_LOGO) ) { $C->HDR_SHOW_LOGO = 1; }
			if( ! isset($C->HDR_CUSTOM_LOGO) ) { $C->HDR_CUSTOM_LOGO = ''; }
			if( ! isset($C->HDR_SHOW_FAVICON) ) { $C->HDR_SHOW_FAVICON = 1; }
			if( ! isset($C->HDR_CUSTOM_FAVICON) ) { $C->HDR_CUSTOM_FAVICON = ''; }
			if( ! isset($C->MOBI_DISABLED) ) { $C->MOBI_DISABLED = 0; }
			
			$current_language	= new stdClass;
			include($C->INCPATH.'languages/'.$C->LANGUAGE.'/language.php');
			setlocale(LC_ALL, $current_language->php_locale);
			
			if( ! isset($C->DEF_TIMEZONE) ) {
				$C->DEF_TIMEZONE	= $current_language->php_timezone;
			}
			date_default_timezone_set($C->DEF_TIMEZONE);
			
			if( !isset($C->SITE_TITLE) || empty($C->SITE_TITLE) ) {
				$C->SITE_TITLE	= 'Sharetronix';
			}
			$C->OUTSIDE_SITE_TITLE	= $C->SITE_TITLE;
		}
		
		

	}
	
?>